$(document).ready(function(){
	var sid=$('#Id').val();
	genDictSelect('ResourceType','resource_category1','1');
	 $("#resource_category1").attr("disabled", "disabled");
	eventBind();
	viewResource(sid)
});
// 事件绑定
function eventBind(){
	$('#cancel').click(function(){
		BootstrapDialog.closeAll();
	})
}

//查看教育资源
function viewResource(sid){
	$.getApiClient('/study/select/{Id}').setQuery({Id:sid}).get().done(function(data){
		if(data.code == "0"){
			var payload=data.payload;
			$('#resource_name1').val(payload.resource_name);
			$('#resource_type1').val(payload.resource_type);
			$('#resource_category1').val(payload.resource_category);
			genDictSelect('ResourceType','resource_category1',payload.resource_category);
			$('#resource_desc1').val(payload.resource_desc);
		}else{
			customAlertDialog(data.message, '错误提示', null, null);
		}
	});
}
